The present invention relates to a program-controlled computer comprising an arithmetic unit for processing floating-point data.
Arithmetic operations between floating-point data items in a computer are inevitably accompanied by occurrences of errors because the length of data representation is limited to a finite value. Specifically, there have been commonly known two causes of such errors, namely, "loss of significant digits" and "left-off" in the addition and subtraction. The loss of significant digits represents, in a subtraction effected upon two data items each having a similar value, that the number of significant digits of the mantissa is reduced. In an extreme case, the mantissa contains zero as a result of an arithmetic operation, namely, the significant digits are lost, and hence, this is called "loss of significance". On the other hand, left-off represents that, in an operation effected on two data items the magnitudes of which are greatly different from each other, that the mantissa of the data item having a smaller absolute value, as a result of adjustment of the digit positions, underflows from the lower-most significant digit and becomes zero, which cannot be reflected on the operation result. Consequently, in arithmetic operations on such data items, a considerable error may result if the sequence of the arithmetic operations is not carefully determined because the phenomena associated with small data items may contribute to the operation result.
Although the frequency of error occurrences can be generally minimized by the use of data with a long precision, this causes the necessary storage capacity and the processing time to be increased, and therefore the number of data items to which the long precision is assigned must be reduced to the optimal value. However, since the occurrences of errors depend on the data to be subjected to arithmetic operations, the frequency of error occurrences cannot be easily estimated when a program is prepared.
In the past, consequently, the long precision was assigned to all data items for which the "left-off" may possibly take place or a particular countermeasure was provided for each location for which such an error is likely to occur based on the final result of the operation, which leads to problems that the storage area and the amount of processing are increased and that the precision cannot be easily controlled. For the "loss of significant digits" of those two error causes described above, and particularly for "loss of significance", there has been well known a system for monitoring the error. (For example, refer to Section 6 of the "IBM 370 Principles of Operation" published by International Business Machines Corp.)